GemaLuaCoreLib
The GeMA Lua Core library
Loading...
Searching...
No Matches
GmLuaObject Class Referenceabstract

A proxy class to export object methods to the Lua environment. More...

#include <gmLuaObject.h>

Inheritance diagram for GmLuaObject:
Collaboration diagram for GmLuaObject:

Public Member Functions

virtual ~GmLuaObject ()
 Destrutor.
 
virtual void populateMetatable (lua_State *L, int index)
 Fills the object metatable to allow for the proxy to export its methods.
 
QVariant ptrToVariant ()
 Constructs a QVariant storing a POINTER to the current object.
 
void ref ()
 Increments the object reference count. Use with care.
 
- Public Member Functions inherited from LuaProxy::Base
virtual void * getClassMetatableID ()=0
 

Protected Member Functions

 GmLuaObject (const GmLogCategory &logger)
 Construtor protegido. Somente classes derivadas devem ser instanciadas.
 
virtual const char * typeName () const =0
 Returns the object type as will be stored in the object metatable.
 
virtual QString toString () const
 Default method used by the __tostring metamethod to capture the result of tostring() over an object.
 
virtual void fillMetatable (lua_State *L, int index)=0
 Function called by populateMetatable() to fill the metatable with exported methods by derived classes.
 

Protected Attributes

const GmLogCategory_logger
 A logger used by the proxy when needed.
 
QAtomicInteger< int > _refCount
 Lua objects are reference counted to enable sharing them among different states. This is needed to allow for passing objects as parameters in a parallel call. The garbage collection method releases memory only for the last reference.
 

Private Member Functions

 Q_DISABLE_COPY (GmLuaObject)
 
int gc (lua_State *L)
 Garbage collection function for proxy objects. Deletes the proxy (which can then release memory, if needed, in its own destructor)
 
int tostring (lua_State *L)
 Tostring metamethod.
 

Detailed Description

A proxy class to export object methods to the Lua environment.

Member Function Documentation

◆ fillMetatable()

virtual void GmLuaObject::fillMetatable ( lua_State * L,
int index )
protectedpure virtual

Function called by populateMetatable() to fill the metatable with exported methods by derived classes.

Implemented in GmLuaAccessorBase< T >, GmLuaAccessorBase< GmBoundaryConditionAccessor >, GmLuaAccessorBase< GmCellAccessor >, GmLuaAccessorBase< GmContactBoundaryConditionAccessor >, GmLuaAccessorBase< GmDiscontinuityAccessor >, GmLuaAccessorBase< GmGaussAccessor >, GmLuaAccessorBase< GmValueAccessor >, GmLuaAccessorIndex< T, I >, GmLuaAccessorIndex< GmCellAccessor, const GmCell * >, GmLuaAccessorIndex< GmDiscontinuityAccessor, const GmDiscontinuity * >, GmLuaAccessorIndex< GmValueAccessor, int >, GmLuaBCAccessor< T, B >, GmLuaBCAccessor< GmBoundaryConditionAccessor, GmBoundaryCondition >, GmLuaBCAccessor< GmContactBoundaryConditionAccessor, GmContactBoundaryCondition >, GmLuaBorderIntegrationRule, GmLuaBoundaryCondition, GmLuaBoundaryConditionAccessor, GmLuaBoundaryConditionBase, GmLuaCell, GmLuaCellAccessor, GmLuaCellBoundary, GmLuaCellGeometry, GmLuaCellGroupSet, GmLuaCellMesh, GmLuaContactBoundaryCondition, GmLuaContactBoundaryConditionAccessor, GmLuaDiscontinuity, GmLuaDiscontinuityAccessor, GmLuaDiscontinuitySet, GmLuaElement, GmLuaElementMesh, GmLuaGaussAccessor, GmLuaGaussCloudToPointInterpolator, GmLuaGaussNeighborsToNodeInterpolator, GmLuaGaussToNodeInterpolator, GmLuaGaussToPointInterpolator, GmLuaHElement, GmLuaIntegrationRule, GmLuaMatrix, GmLuaMesh, GmLuaModelData, GmLuaNodeCloudToPointInterpolator, GmLuaNodeSet, GmLuaNodeToPointInterpolator, GmLuaNodeValueAccessor, GmLuaPropertySet, GmLuaRegularGridMesh, GmLuaShape, GmLuaSpatialIndex, GmLuaStateDump, GmLuaValueAccessor, and GmLuaValueInfo.

◆ populateMetatable()

void GmLuaObject::populateMetatable ( lua_State * L,
int index )
virtual

Fills the object metatable to allow for the proxy to export its methods.

Implements LuaProxy::Base.

◆ toString()

◆ typeName()


The documentation for this class was generated from the following files: